import request from "@/utils/request";

// 1 上传文件  封装出来 单独上传文件
export const pictureAdd = (data) => {
  return request({
    url: "/image/gallery/upload",
    method: "POST",
    data: data,
  });
};

// 03、读取图片列表
export const pictureList = (query) => {
  console.log("query: ", query);
  return request({
    url: "/image/gallery/list",
    headers: { "content-type": "application/x-www-form-urlencoded" },
    method: "POST",
    params: query,
  });
};

// 02、图片删除
export const pictureRemove = (id) => {
  return request({
    url: `/image/gallery/remove/${id}`,
    headers: { "content-type": "application/x-www-form-urlencoded" },
    method: "POST",
  });
};

// 05、读取水印列表
export const listWatermark = () => {
  return request({
    url: `/image/watermark/list`,
    method: "POST",
  });
};

// 04、新增和更新水印
export const addWatermark = (data) => {
  return request({
    url: `/image/watermark/save`,
    method: "POST",
    data: data,
  });
};
